#ifndef __COM_DEVICE_H
#define __COM_DEVICE_H
#include "board.h"
typedef struct com_dev_s {
  char name[16];
  unsigned int timestamp;
  int (*write)(void*, int);
  int (*read)(void*, int);
  int (*irq_callback)(void*);
  int recv_size;
  unsigned char *recv_buf;
  int send_size;
  unsigned char *send_buf;
  struct com_dev_s *next;
} com_dev_t;
extern com_dev_t *com_list_head;
extern com_dev_t dev_uart1;
extern com_dev_t dev_uart2;
extern com_dev_t dev_uart3;
extern rt_sem_t com_dev_sem;
int com_device_init(void);
void com_irq_register(com_dev_t *p_com, int (*callback_entry)(void*));
#endif
